package com.cloudbroker.bcs.platform.ltb.middle.service.impl;

import com.cloudbroker.bcs.common.dao.base.DAOBase;
import com.cloudbroker.bcs.platform.ltb.common.config.ConfigValues;
import com.cloudbroker.bcs.platform.ltb.middle.dao.AskDAO;
import com.cloudbroker.bcs.platform.ltb.middle.entity.Ask;
import com.cloudbroker.bcs.platform.ltb.middle.entityview.AskParam;
import com.cloudbroker.bcs.platform.ltb.middle.entityview.AskView;
import com.cloudbroker.bcs.platform.ltb.middle.entityview.LeaderAskParam;
import com.cloudbroker.bcs.platform.ltb.middle.service.AskService;
import com.cloudbroker.bcs.platform.ltb.middle.service.base.TenantServiceImplBase;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by daibd19671 on 2016/11/18.
 */
@Service
public class AskServiceImpl extends TenantServiceImplBase<Ask,String> implements AskService  {

    @Resource
    private AskDAO askDAO;
    @Override
    public void askAdd(Ask ask) {
        ask.setMycat_flag(ConfigValues.getMycatFlag());
        askDAO.add(ask);
    }

    @Override
    public int countAsk(AskParam param) {
        return askDAO.countAsk(param);
    }

    @Override
    public Ask getAsk(Ask ask) {
        return askDAO.getAsk(ask);
    }

    @Override
    public void removeAsk(Ask ask) {
        askDAO.removeAsk(ask);
    }


    @Override
    protected DAOBase<Ask, String> getDAO() {
        return askDAO;
    }

    @Override
    public List<Ask> qryAsk(AskParam param) {
        return askDAO.qryAsk(param);
    }

    @Override
    public List<Ask> qryByAskId(Ask ask) {
        return askDAO.qryByAskId(ask);
    }

    @Override
    public List<Ask> qryByAsnwerId(List<Long> idList) {
        return askDAO.qryByAsnwerId(idList);
    }

    @Override
    public int countAnswer(Ask ask) {
        return askDAO.countAnswer(ask);
    }

    @Override
    public void updateAsk(Ask tempResult) {
        askDAO.updateAsk(tempResult);
    }

    @Override
    public List<Ask> searchAsk(Ask ask) {
        return askDAO.searchAsk(ask);
    }

    @Override
    public List<Ask> qryByAskIdList(List<Long> idList) {
        return askDAO.qryByAskIdList(idList);
    }

    @Override
    public List<Ask> getLastAnswerByLeaderId(List<Long> list) {
        return askDAO.getLastAnswerByLeaderId(list);
    }

    @Override
    public int leaderCountAsk(LeaderAskParam param) {
        return askDAO.leaderCountAsk(param);
    }

    @Override
    public List<Ask> leaderQryAsk(LeaderAskParam param) {
        return askDAO.leaderQryAsk(param);
    }
}
